var a = getApp();

Page({
  data: {
    header: [],
    managers: [],
    members: [],
    noFlag: !1,
    // searchFlag: !1,
    searchFlag:1,
    searchList:[
      {
        doctorId:1,
        userIcon: '/assets/images/795.png',
        doctorName:'小明',
        nmDepartment:'骨科',
        activeFlag:0,
        jobType:1,
        nmHospital: '山西大医院',
        patientCount:100,
        askNum:200,
        bgGoodAt: '接骨'
      },
      {
        doctorId: 1,
        userIcon: '/assets/images/795.png',
        doctorName: '小明',
        nmDepartment: '骨科',
        activeFlag: 1,
        jobType: 2,
        nmHospital: '山西大医院',
        patientCount: 100,
        askNum: 200,
        bgGoodAt: '接骨'
      }
    ],
    header: [
      {
        doctorId: 1,
        userIcon: '/assets/images/795.png',
        doctorName: '小明',
        nmDepartment: '骨科',
        activeFlag: 0,
        jobType: 1,
        nmHospital: '山西大医院',
        patientCount: 100,
        askNum: 200,
        bgGoodAt: '接骨'
      },
      {
        doctorId: 1,
        userIcon: '/assets/images/795.png',
        doctorName: '小明',
        nmDepartment: '骨科',
        activeFlag: 1,
        jobType: 2,
        nmHospital: '山西大医院',
        patientCount: 100,
        askNum: 200,
        bgGoodAt: '接骨'
      }
    ],
    managers: [
      {
        doctorId: 1,
        userIcon: '/assets/images/795.png',
        doctorName: '小明',
        nmDepartment: '骨科',
        activeFlag: 0,
        jobType: 1,
        nmHospital: '山西大医院',
        patientCount: 100,
        askNum: 200,
        bgGoodAt: '接骨'
      },
      {
        doctorId: 1,
        userIcon: '/assets/images/795.png',
        doctorName: '小明',
        nmDepartment: '骨科',
        activeFlag: 1,
        jobType: 2,
        nmHospital: '山西大医院',
        patientCount: 100,
        askNum: 200,
        bgGoodAt: '接骨'
      }
    ],
    members:[
        {
          doctorId: 1,
          userIcon: '/assets/images/795.png',
          doctorName: '小明',
          nmDepartment: '骨科',
          activeFlag: 0,
          jobType: 1,
          nmHospital: '山西大医院',
          patientCount: 100,
          askNum: 200,
          bgGoodAt: '接骨'
        },
        {
          doctorId: 1,
          userIcon: '/assets/images/795.png',
          doctorName: '小明',
          nmDepartment: '骨科',
          activeFlag: 1,
          jobType: 2,
          nmHospital: '山西大医院',
          patientCount: 100,
          askNum: 200,
          bgGoodAt: '接骨'
        }
      ],
  },
  onLoad: function (e) {
    var bgc = wx.getStorageSync('color')
    wx.setNavigationBarColor({
      frontColor: "#ffffff",
      backgroundColor: bgc,
    })
    // var t = this;
    // t.setData({
    //   teamId: e.teamId
    // }), wx.request({
    //   url: a.globalData.patient + "team/sign/memberlist/" + e.teamId,
    //   success: function(a) {
    //     console.log(a), 200 == a.data.code && t.setData({
    //       header: a.data.data.header,
    //       managers: a.data.data.managers,
    //       members: a.data.data.members
    //     });
    //   }
    // });
  },
  getText: function(e) {
    console.log(e);
    var t = this;
    t.setData({
      noFlag: !1,
      searchFlag: !1
    }), "" != e.detail.value ? wx.request({
      url: a.globalData.patient + "team/sign/searchDoctor",
      method: "POST",
      header: {
        "content-type": "application/x-www-form-urlencoded"
      },
      data: {
        doctorName: e.detail.value,
        teamId: t.data.teamId
      },
      success: function(a) {
        if (console.log(a), 200 == a.data.code) {
          if (a.data.data.length <= 0) return void t.setData({
            noFlag: !0,
            searchFlag: !0
          });
          t.setData({
            searchList: a.data.data,
            searchFlag: !0
          });
        }
      }
    }) : t.setData({
      searchList: [],
      searchFlag: !1
    });
  },
  onReady: function() {},
  onShow: function() {},
  onHide: function() {},
  onUnload: function() {},
  onPullDownRefresh: function() {},
  onReachBottom: function() {},
  onShareAppMessage: function() {}
});